package lumis.portal.sendmail;

import java.util.Collection;

import lumis.portal.PortalContext;
import lumis.portal.stability.StableMinor;

/**
 * Stores information of the mail body. 
 * @since 4.0.4
 * @version $Revision: 13082 $ $Date: 2011-05-27 16:03:12 -0300 (Fri, 27 May 2011) $
 */
@StableMinor(version = "6.0", sinceVersion = "4.0")
public interface IMailBody
{
	/**
	 * Returns a collection of attachments for this mail.
	 * This collection may be manipulated by obtaining it
	 * using this method, and then using the collection api.
	 * @return the collection of attachments for this mail.
	 * @see ISendMailManager#createMailAttachment()
	 * @since 4.0.4
	 */
	public Collection<IMailAttachment> getAttachments();

	/**
	 * The HTML message in the body, or null if 
	 * there is no HTML message.
	 * <p>
	 * The value returned has all relative paths converted into absolute paths 
	 * using the {@link PortalContext#getFrameworkUrl()} to compose all paths.
	 * Absolute paths are not changed. The persisted original value is not changed.
	 * @return the HTML message in the body.
	 * @see #getTextMsg() 
	 * @since 4.0.4
	 */
	public String getHtmlMsg();

	/**
	 * Sets the HTML message in the body. Relative paths are converted 
	 * into absolute paths in the value returned by {@link IMailBody#getHtmlMsg()}.
	 * @param htmlMsg the HTML message value to set.
	 * @see #setTextMsg(String)
	 * @see #getHtmlMsg() 
	 * @since 4.0.4
	 */
	public void setHtmlMsg(String htmlMsg);

	/**
	 * Returns the text message in the body, or null
	 * if there is no text message. If a html message
	 * was also set, the text message will be used as a 
	 * fallback by email clients that has no html support. 
	 * @return the text message in the body.
	 * @see #getHtmlMsg()
	 * @since 4.0.4
	 */
	public String getTextMsg();

	/**
	 * Sets the text message for this mail.
	 * @param textMsg the text message value.
	 * @see #getTextMsg()
	 * @see #setHtmlMsg(String)
	 * @since 4.0.4
	 */
	public void setTextMsg(String textMsg);
}